package com.qing.administer.result;

import lombok.Data;

@Data
public class CommonException extends  RuntimeException implements  CommonEnum{

    private CommonEnum commonEnum;

    public CommonException(CommonEnum commonEnum) {
        this.commonEnum = commonEnum;
    }

    public CommonException(CommonEnum commonEnum,String errMsg) {
        this.commonEnum = commonEnum;
        this.setErrorMsg(errMsg);
    }



    @Override
    public Integer getCode() {
        return this.commonEnum.getCode();
    }

    @Override
    public CommonEnum setErrorMsg(String errorMsg) {
        this.commonEnum.setErrorMsg(errorMsg);
        return this;
    }



}
